<template>
    <mi-select v-model="value_c" :options="options" v-loading="edit.loading" />
</template>

<script setup lang="ts">

import {simpleGet} from "@/utils/request";
import {computed, onBeforeMount, reactive, ref} from "vue";
import Edit from "@/model/edit";

const props = withDefaults(defineProps<{
    modelValue?: number
}>(), {

})
const emits = defineEmits(['update:modelValue'])

const value_c = computed({
    get: () => {
        return props.modelValue
    },
    set: (val) => {
        emits('update:modelValue', val)
    }
})

const edit = reactive(new Edit({}))
const options = ref([])

onBeforeMount(() => {
    edit.init(async () => {
        // 请求角色选项
        let optionsRes = await simpleGet('/auth.adminGroup/options')
        options.value = optionsRes.options
    })
})





</script>

<style scoped>

</style>
